/****************************************************************************
 * Copyright (C) 2011 Maxim Integrated Products, All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL MAXIM INTEGRATED PRODUCTS BE LIABLE FOR ANY CLAIM, DAMAGES
 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Except as contained in this notice, the name of Maxim Integrated Products
 * shall not be used except as stated in the Maxim Integrated Products
 * Branding Policy.
 *
 * The mere transfer of this software does not imply any licenses
 * of trade secrets, proprietary technology, copyrights, patents,
 * trademarks, maskwork rights, or any other form of intellectual
 * property whatsoever. Maxim Integrated Products retains all ownership rights.
 *
 *     Description: MAXQ1741 timed delay
 *             $Id: maxq_delay.h 5786 2012-11-19 20:14:53Z jeremy.brodt $
 *
 ********************************************************************************
 */

/** 
* \file
* \brief    Performs timed delays
* \details  This file defines the driver API including data types and function
*           prototypes.
* \details  The implementation of this driver is product specific and may
*           utilize hardware resources. Review the driver implementation for
*           details of specific resource utilization.
*/

#ifndef _DELAY_H_
#define _DELAY_H_

/***** Function Prototypes *****/

/** 
*   \brief    Executes a delay of the specified duration
*   \param    ms   number of milliseconds to delay
*   \note     This function implementation is product specific and may utilize
*             a hardware timer. Review the function implementation for resource
*             utilization. If the hardware resource is not available, this
*             function will return immediately.
*   \returns  #MAXQ_SUCCESS if successful, #MAXQ_FAILURE if resource was not available
*/
int delay_ms(unsigned int ms);

/** 
*   \brief    Executes a delay of the specified duration
*   \param    us   number of microseconds to delay
*   \note     This function implementation is product specific and may utilize
*             a hardware timer. Review the function implementation for resource
*             utilization. If the hardware resource is not available, this
*             function will return immediately.
*   \returns  #MAXQ_SUCCESS if successful, #MAXQ_FAILURE if resource was not available
*/
int delay_us(unsigned int us);

#endif /* _DELAY_H_ */
